package com.fss.plant.controller;

import com.fss.home.domain.Home;

import com.fss.home.service.HomeService;
import com.fss.common.core.controller.BaseController;
import com.fss.plant.domain.Expert;
import com.fss.plant.domain.User;
import com.fss.plant.service.ExpertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * 贷款申请Controller
 *
 * @author ruoyi
 * @date 2024-10-26
 */
@RestController
@RequestMapping("/plan")
public class PlanController extends BaseController
{
    @Autowired
    private ExpertService expertService;


    @GetMapping("/getExperts")
    public List<Expert> getExperts() {
        List<User> userList =   expertService.getExpertList();
        System.out.println(userList);
        List<Expert> expertList=new ArrayList<>();
        for (User user : userList)
        {
            expertList.add(new Expert(getUserId(),user.getUserName(),user.getAvatar(),user.getRemark(),user.getLoginIp()));
        }
        System.out.println(expertList);
        return expertList;
    }


}
